<?php
foreach ($this->scripts as $scripts)
{
	$controller = $scripts['controller'];
	$group = '';
	$title = '';
	switch ($controller)
	{
		case 'index':
			$group .= 'Admin';
			$title .= 'Trang quản trị';
			break;
		case 'admin-member':
			$group .= 'Member';
			$title .= 'Trang thành viên';
			break;
		case 'admin-group':
			$group .= 'Group';
			$title .= 'Nhóm thành viên';
			break;
		case 'admin-privilege':
			$group .= 'Privilege';
			$title .= 'Trang phân quyền';
			break;
	}
?>
var <?php echo $group; ?>Group = {
        xtype: 'fieldset',
        id: '<?php echo $group; ?>Group',
        width: 780,
        title: '<?php echo $title; ?>',
        layout: 'form',
        items: [{
            xtype: 'checkboxgroup',
            items: [
            <?php foreach ($scripts['action'] as $action) 
			{
			?>
            {boxLabel: '<?php echo $action['name']; ?>', name: '<?php echo $controller . '_' . $action['action']; ?>'},
            <?php
			}
			?>
			]
       }]
};
<?php
}
?>